package com.duoec.dw.lineage.service.analyser;

import com.alibaba.druid.sql.ast.statement.SQLSelectQuery;
import com.alibaba.druid.sql.ast.statement.SQLWithSubqueryClause;
import com.duoec.dw.lineage.dto.MultiTableLineageDto;
import com.duoec.dw.lineage.dto.TableLineageDto;

/**
 * select 分析处理器
 *
 * @author xuwenzhen
 */
public interface HiveQueryAnalyser<T extends SQLSelectQuery> {
    /**
     * 获取当前类处理的类型
     *
     * @return SQLSelectQuery子类类型
     */
    Class<T> getSelectQueryType();

    /**
     * 解析 select
     *
     * @param sqlSelectQuery      需要解析的select
     * @param withAsTableLineages with-in
     * @return 当前select脚本的血缘关系
     */
    TableLineageDto analyse(T sqlSelectQuery, MultiTableLineageDto withAsTableLineages);
}
